<?php
class ArticleTypeModel extends Model{
	protected $_auto = array(
		array('created_at','strtotime',3,'function'),
		array('updated_at','get_last_time',3,'callback'),
		array('sort','intval',3,'function')
	);

	protected $_validate = array(
		array('name','require','文章类别名称不能为空...'),
		array('key','','文章类别类键字被占用,请重新输入...',0,'unique'),
		array('type',array(0,1),'类别模型只能为文本或图文...',0,'in')
	);

	public function get_last_time(){
		return max(time(),strtotime($_POST['created_at']));
	}
}
?>